package cn.xy.base.server.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import cn.xy.base.server.dao.SysImportLogDao;
import cn.xy.base.server.po.SysImportLog;
import cn.xy.base.server.service.SysImportLogService;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * SysImportLog对应的服务类实现
 *
 * @author auto
 */

@Service
public class SysImportLogServiceImpl extends ServiceImpl<SysImportLogDao, SysImportLog> implements SysImportLogService {

    @Override
    public List<SysImportLog> listByIdIn(List<Integer> idList) {
        if (CollUtil.isEmpty(idList)) {
            return new ArrayList<>();
        }
        return this.listByIds(idList);
    }

    @Override
    public Map<Integer, SysImportLog> mapByIdIn(List<Integer> idList) {
        List<SysImportLog> sysImportLogList = this.listByIdIn(idList);
        return sysImportLogList.stream().collect(Collectors.toMap(SysImportLog::getId, b -> b));
    }
}
